#custom make file created from sdk templace for libs
#ported by kehon SDL_draw library for SDL for psp

PSPSDK=$(shell psp-config --pspsdk-path)
PSPDEV=$(shell psp-config --psp-prefix)
PSPBIN=$(PSPDEV)/bin
INSTALL_DIR=$(shell $(PSPBIN)/sdl-config --prefix)/include/SDL

TARGET_LIB = libSDL_draw.a
OBJS = SDL_draw.o 

INCDIR = 
DEFS = -DPACKAGE=\"SDL_draw\" -DVERSION=\"1.2.1\" 
CFLAGS = -O2 -G0 -Wall -g -Dmain=SDL_main $(DEFS) 
CFLAGS += -I../include $(shell $(PSPBIN)/sdl-config --cflags) 
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS = -L$(PSPSDK)/lib -L$(PSPDEV)/lib -lc -lpspuser 

LIBS = $(shell $(PSPBIN)/sdl-config --libs) 
#       -lSDLmain -lSDL -lm -lGL -lpspvfpu  \
#	   -lpspdebug -lpspgu -lpspctrl -lpspge \
#	   -lpspdisplay -lpsphprm -lpspsdk -lpsprtc \
#	   -lpspaudio -lc -lpspuser -lpsputility -lpspkernel \
#	    -lpspnet_inet -lpspirkeyb -lpsppower 

include $(PSPSDK)/lib/build.mak

install: 
	@echo Installing SDL_draw...
	@mkdir -p $(INSTALL_DIR)
	@mkdir -p $(PSPDEV)/lib
	cp -f ../include/SDL_draw.h $(INSTALL_DIR)
	cp -f $(TARGET_LIB) $(PSPDEV)/lib
	@echo done!
